<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>iCloud Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">iCloud Framework </a></h1>
				<a id="developerHome" href="../index.html">iRare Media</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">iCloud Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/delegate">&nbsp;&nbsp;&nbsp;&nbsp;delegate</option>
	
	<option value="//api/name/fileList">&nbsp;&nbsp;&nbsp;&nbsp;fileList</option>
	
	<option value="//api/name/previousQueryResults">&nbsp;&nbsp;&nbsp;&nbsp;previousQueryResults</option>
	
	<option value="//api/name/query">&nbsp;&nbsp;&nbsp;&nbsp;query</option>
	
	<option value="//api/name/verboseAvailabilityLogging">&nbsp;&nbsp;&nbsp;&nbsp;verboseAvailabilityLogging</option>
	
	<option value="//api/name/verboseLogging">&nbsp;&nbsp;&nbsp;&nbsp;verboseLogging</option>
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/sharedCloud">&nbsp;&nbsp;&nbsp;&nbsp;+ sharedCloud</option>
	
	<option value="//api/name/updateFilesWithDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;+ updateFilesWithDelegate:</option>
	
	<option value="//api/name/uploadLocalOfflineDocumentsWithDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;+ uploadLocalOfflineDocumentsWithDelegate:</option>
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/checkCloudAvailability">&nbsp;&nbsp;&nbsp;&nbsp;- checkCloudAvailability</option>
	
	<option value="//api/name/checkCloudUbiquityContainer">&nbsp;&nbsp;&nbsp;&nbsp;- checkCloudUbiquityContainer</option>
	
	<option value="//api/name/deleteDocumentWithName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- deleteDocumentWithName:completion:</option>
	
	<option value="//api/name/documentStateForFile:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- documentStateForFile:completion:</option>
	
	<option value="//api/name/doesFileExistInCloud:">&nbsp;&nbsp;&nbsp;&nbsp;- doesFileExistInCloud:</option>
	
	<option value="//api/name/duplicateOriginalDocument:withNewName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- duplicateOriginalDocument:withNewName:completion:</option>
	
	<option value="//api/name/evictCloudDocumentWithName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- evictCloudDocumentWithName:completion:</option>
	
	<option value="//api/name/fileCreatedDate:">&nbsp;&nbsp;&nbsp;&nbsp;- fileCreatedDate:</option>
	
	<option value="//api/name/fileModifiedDate:">&nbsp;&nbsp;&nbsp;&nbsp;- fileModifiedDate:</option>
	
	<option value="//api/name/fileSize:">&nbsp;&nbsp;&nbsp;&nbsp;- fileSize:</option>
	
	<option value="//api/name/findUnresolvedConflictingVersionsOfFile:">&nbsp;&nbsp;&nbsp;&nbsp;- findUnresolvedConflictingVersionsOfFile:</option>
	
	<option value="//api/name/getListOfCloudFiles">&nbsp;&nbsp;&nbsp;&nbsp;- getListOfCloudFiles</option>
	
	<option value="//api/name/listCloudFiles">&nbsp;&nbsp;&nbsp;&nbsp;- listCloudFiles</option>
	
	<option value="//api/name/monitorDocumentStateForFile:onTarget:withSelector:">&nbsp;&nbsp;&nbsp;&nbsp;- monitorDocumentStateForFile:onTarget:withSelector:</option>
	
	<option value="//api/name/renameOriginalDocument:withNewName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- renameOriginalDocument:withNewName:completion:</option>
	
	<option value="//api/name/resolveConflictForFile:withSelectedFileVersion:">&nbsp;&nbsp;&nbsp;&nbsp;- resolveConflictForFile:withSelectedFileVersion:</option>
	
	<option value="//api/name/retrieveCloudDocumentObjectWithName:">&nbsp;&nbsp;&nbsp;&nbsp;- retrieveCloudDocumentObjectWithName:</option>
	
	<option value="//api/name/retrieveCloudDocumentWithName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- retrieveCloudDocumentWithName:completion:</option>
	
	<option value="//api/name/saveAndCloseDocumentWithName:withContent:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- saveAndCloseDocumentWithName:withContent:completion:</option>
	
	<option value="//api/name/saveChangesToDocumentWithName:withContent:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- saveChangesToDocumentWithName:withContent:completion:</option>
	
	<option value="//api/name/shareDocumentWithName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- shareDocumentWithName:completion:</option>
	
	<option value="//api/name/stopMonitoringDocumentStateChangesForFile:onTarget:">&nbsp;&nbsp;&nbsp;&nbsp;- stopMonitoringDocumentStateChangesForFile:onTarget:</option>
	
	<option value="//api/name/ubiquitousContainerURL">&nbsp;&nbsp;&nbsp;&nbsp;- ubiquitousContainerURL</option>
	
	<option value="//api/name/ubiquitousDocumentsDirectoryURL">&nbsp;&nbsp;&nbsp;&nbsp;- ubiquitousDocumentsDirectoryURL</option>
	
	<option value="//api/name/updateFiles">&nbsp;&nbsp;&nbsp;&nbsp;- updateFiles</option>
	
	<option value="//api/name/uploadLocalDocumentToCloudWithName:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- uploadLocalDocumentToCloudWithName:completion:</option>
	
	<option value="//api/name/uploadLocalOfflineDocumentsWithRepeatingHandler:completion:">&nbsp;&nbsp;&nbsp;&nbsp;- uploadLocalOfflineDocumentsWithRepeatingHandler:completion:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Singleton">Singleton</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Delegate">Delegate</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Properties">Properties</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Checking for iCloud">Checking for iCloud</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Syncing with iCloud">Syncing with iCloud</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Uploading to iCloud">Uploading to iCloud</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Sharing iCloud Content">Sharing iCloud Content</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Deleting iCloud Content">Deleting iCloud Content</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Retrieving iCloud Content and Info">Retrieving iCloud Content and Info</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Managing iCloud Content">Managing iCloud Content</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_iCloud Document State">iCloud Document State</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Resolving iCloud Conflicts">Resolving iCloud Conflicts</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Deprecated Methods">Deprecated Methods</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/delegate">delegate</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/fileList">fileList</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/previousQueryResults">previousQueryResults</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/query">query</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/verboseAvailabilityLogging">verboseAvailabilityLogging</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/verboseLogging">verboseLogging</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/sharedCloud">sharedCloud</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/updateFilesWithDelegate:">updateFilesWithDelegate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/uploadLocalOfflineDocumentsWithDelegate:">uploadLocalOfflineDocumentsWithDelegate:</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/checkCloudAvailability">checkCloudAvailability</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/checkCloudUbiquityContainer">checkCloudUbiquityContainer</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/deleteDocumentWithName:completion:">deleteDocumentWithName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/documentStateForFile:completion:">documentStateForFile:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/doesFileExistInCloud:">doesFileExistInCloud:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/duplicateOriginalDocument:withNewName:completion:">duplicateOriginalDocument:withNewName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/evictCloudDocumentWithName:completion:">evictCloudDocumentWithName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/fileCreatedDate:">fileCreatedDate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/fileModifiedDate:">fileModifiedDate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/fileSize:">fileSize:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/findUnresolvedConflictingVersionsOfFile:">findUnresolvedConflictingVersionsOfFile:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/getListOfCloudFiles">getListOfCloudFiles</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/listCloudFiles">listCloudFiles</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/monitorDocumentStateForFile:onTarget:withSelector:">monitorDocumentStateForFile:onTarget:withSelector:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renameOriginalDocument:withNewName:completion:">renameOriginalDocument:withNewName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/resolveConflictForFile:withSelectedFileVersion:">resolveConflictForFile:withSelectedFileVersion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/retrieveCloudDocumentObjectWithName:">retrieveCloudDocumentObjectWithName:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/retrieveCloudDocumentWithName:completion:">retrieveCloudDocumentWithName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveAndCloseDocumentWithName:withContent:completion:">saveAndCloseDocumentWithName:withContent:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/saveChangesToDocumentWithName:withContent:completion:">saveChangesToDocumentWithName:withContent:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/shareDocumentWithName:completion:">shareDocumentWithName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/stopMonitoringDocumentStateChangesForFile:onTarget:">stopMonitoringDocumentStateChangesForFile:onTarget:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/ubiquitousContainerURL">ubiquitousContainerURL</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/ubiquitousDocumentsDirectoryURL">ubiquitousDocumentsDirectoryURL</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/updateFiles">updateFiles</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/uploadLocalDocumentToCloudWithName:completion:">uploadLocalDocumentToCloudWithName:completion:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/uploadLocalOfflineDocumentsWithRepeatingHandler:completion:">uploadLocalOfflineDocumentsWithRepeatingHandler:completion:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="iCloud Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">iCloud Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">iCloud.h</td>
</tr>
						</tbody></table></div>
					
					
					
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should&rsquo;ve been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on <a href="http://www.github.com/iRareMedia/iCloudDocumentSync">GitHub</a>. If you like the project, please star it on GitHub!</p>

<p>The <code>iCloud</code> class provides methods to integrate iCloud into document projects.</p>

<p>Adding iCloud Document Sync to your project is easy. Follow these steps below to get everything up and running.</p>

<ol>
<li>Drag the iCloud Framework into your project</li>
<li>Add <code>#import &lt;iCloud/iCloud.h&gt;</code> to your header file(s) iCloud Document Sync</li>
<li>Subscribe to the <a href="../Protocols/iCloudDelegate.html"><code>iCloudDelegate</code></a> <a href="#//api/name/delegate">delegate</a>.</li>
<li><p>Call the following methods to setup iCloud when your app starts:</p>

<p> [[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
 [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what&rsquo;s going on with iCloud, this is OFF by default
 [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented</p></li>
</ol>
<div class="warning"><p><strong>Warning:</strong> Only available on iOS 6.0 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app.</p></div>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Singleton" name="task_Singleton"></a>
						<h3 class="subsubtitle task-title">Singleton</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/sharedCloud">+&nbsp;sharedCloud</a></code>
		<span class="tooltip"><p>iCloud shared instance object</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Delegate" name="task_Delegate"></a>
						<h3 class="subsubtitle task-title">Delegate</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/delegate">&nbsp;&nbsp;delegate</a></code>
		<span class="tooltip"><p>iCloud Delegate helps call methods when document processes begin or end</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li>
						</ul>
						
						
						<a title="Properties" name="task_Properties"></a>
						<h3 class="subsubtitle task-title">Properties</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/query">&nbsp;&nbsp;query</a></code>
		<span class="tooltip"><p>The current NSMetadataQuery object</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/fileList">&nbsp;&nbsp;fileList</a></code>
		<span class="tooltip"><p>A list of iCloud files from the current <a href="#//api/name/query">query</a></p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/previousQueryResults">&nbsp;&nbsp;previousQueryResults</a></code>
		<span class="tooltip"><p>A list of iCloud files from the previous <a href="#//api/name/query">query</a></p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/verboseLogging">&nbsp;&nbsp;verboseLogging</a></code>
		<span class="tooltip"><p>Enable verbose logging for detailed feedback in the log. Turning this off only prints crucial log notes such as errors.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/verboseAvailabilityLogging">&nbsp;&nbsp;verboseAvailabilityLogging</a></code>
		<span class="tooltip"><p>Enable verbose availability logging for repeated feedback about iCloud availability in the log. Turning this off will prevent availability-related messages from being printed in the log. This property does not relate to the <a href="#//api/name/verboseLogging">verboseLogging</a> property.</p></span>
	</span>
	<span class="task-item-suffix">property</span>
	
</li>
						</ul>
						
						
						<a title="Checking for iCloud" name="task_Checking for iCloud"></a>
						<h3 class="subsubtitle task-title">Checking for iCloud</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/checkCloudAvailability">&ndash;&nbsp;checkCloudAvailability</a></code>
		<span class="tooltip"><p>Check whether or not iCloud is available and that it can be accessed. Returns a boolean value.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/checkCloudUbiquityContainer">&ndash;&nbsp;checkCloudUbiquityContainer</a></code>
		<span class="tooltip"><p>Check that the current application&rsquo;s iCloud Ubiquity Container is available. Returns a boolean value.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/ubiquitousContainerURL">&ndash;&nbsp;ubiquitousContainerURL</a></code>
		<span class="tooltip"><p>Retrieve the current application&rsquo;s ubiquitous root URL</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/ubiquitousDocumentsDirectoryURL">&ndash;&nbsp;ubiquitousDocumentsDirectoryURL</a></code>
		<span class="tooltip"><p>Retrieve the current application&rsquo;s ubiquitous documents directory URL</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Syncing with iCloud" name="task_Syncing with iCloud"></a>
						<h3 class="subsubtitle task-title">Syncing with iCloud</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/updateFiles">&ndash;&nbsp;updateFiles</a></code>
		<span class="tooltip"><p>Check for and update the list of files stored in your app&rsquo;s iCloud Documents Folder. This method is automatically called by iOS when there are changes to files in the iCloud Directory. The iCloudFilesDidChange:withNewFileNames: <a href="#//api/name/delegate">delegate</a> method is triggered by this method.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Uploading to iCloud" name="task_Uploading to iCloud"></a>
						<h3 class="subsubtitle task-title">Uploading to iCloud</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/saveAndCloseDocumentWithName:withContent:completion:">&ndash;&nbsp;saveAndCloseDocumentWithName:withContent:completion:</a></code>
		<span class="tooltip"><p>Create, save, and close a document in iCloud.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/uploadLocalOfflineDocumentsWithRepeatingHandler:completion:">&ndash;&nbsp;uploadLocalOfflineDocumentsWithRepeatingHandler:completion:</a></code>
		<span class="tooltip"><p>Upload any local files that weren&rsquo;t created with iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/uploadLocalDocumentToCloudWithName:completion:">&ndash;&nbsp;uploadLocalDocumentToCloudWithName:completion:</a></code>
		<span class="tooltip"><p>Upload a local file to iCloud</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Sharing iCloud Content" name="task_Sharing iCloud Content"></a>
						<h3 class="subsubtitle task-title">Sharing iCloud Content</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/shareDocumentWithName:completion:">&ndash;&nbsp;shareDocumentWithName:completion:</a></code>
		<span class="tooltip"><p>Share an iCloud document by uploading it to a public URL.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Deleting iCloud Content" name="task_Deleting iCloud Content"></a>
						<h3 class="subsubtitle task-title">Deleting iCloud Content</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/deleteDocumentWithName:completion:">&ndash;&nbsp;deleteDocumentWithName:completion:</a></code>
		<span class="tooltip"><p>Delete a document from iCloud.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/evictCloudDocumentWithName:completion:">&ndash;&nbsp;evictCloudDocumentWithName:completion:</a></code>
		<span class="tooltip"><p>Evict a document from iCloud, move it from iCloud to the current application&rsquo;s local documents directory.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Retrieving iCloud Content and Info" name="task_Retrieving iCloud Content and Info"></a>
						<h3 class="subsubtitle task-title">Retrieving iCloud Content and Info</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/retrieveCloudDocumentWithName:completion:">&ndash;&nbsp;retrieveCloudDocumentWithName:completion:</a></code>
		<span class="tooltip"><p>Open a UIDocument stored in iCloud. If the document does not exist, a new blank document will be created using the documentName provided. You can use the <a href="#//api/name/doesFileExistInCloud:">doesFileExistInCloud:</a> method to check if a file exists before calling this method.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/retrieveCloudDocumentObjectWithName:">&ndash;&nbsp;retrieveCloudDocumentObjectWithName:</a></code>
		<span class="tooltip"><p>Get the relevant <a href="../Classes/iCloudDocument.html">iCloudDocument</a> object for the specified file</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/doesFileExistInCloud:">&ndash;&nbsp;doesFileExistInCloud:</a></code>
		<span class="tooltip"><p>Check if a file exists in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/fileSize:">&ndash;&nbsp;fileSize:</a></code>
		<span class="tooltip"><p>Get the size of a file stored in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/fileModifiedDate:">&ndash;&nbsp;fileModifiedDate:</a></code>
		<span class="tooltip"><p>Get the last modified date of a file stored in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/fileCreatedDate:">&ndash;&nbsp;fileCreatedDate:</a></code>
		<span class="tooltip"><p>Get the creation date of a file stored in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/listCloudFiles">&ndash;&nbsp;listCloudFiles</a></code>
		<span class="tooltip"><p>Get a list of files stored in iCloud</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Managing iCloud Content" name="task_Managing iCloud Content"></a>
						<h3 class="subsubtitle task-title">Managing iCloud Content</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/renameOriginalDocument:withNewName:completion:">&ndash;&nbsp;renameOriginalDocument:withNewName:completion:</a></code>
		<span class="tooltip"><p>Rename a document in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/duplicateOriginalDocument:withNewName:completion:">&ndash;&nbsp;duplicateOriginalDocument:withNewName:completion:</a></code>
		<span class="tooltip"><p>Duplicate a document in iCloud</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="iCloud Document State" name="task_iCloud Document State"></a>
						<h3 class="subsubtitle task-title">iCloud Document State</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/documentStateForFile:completion:">&ndash;&nbsp;documentStateForFile:completion:</a></code>
		<span class="tooltip"><p>Get the current document state of a file stored in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/monitorDocumentStateForFile:onTarget:withSelector:">&ndash;&nbsp;monitorDocumentStateForFile:onTarget:withSelector:</a></code>
		<span class="tooltip"><p>Monitor changes in the state of a document stored in iCloud</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/stopMonitoringDocumentStateChangesForFile:onTarget:">&ndash;&nbsp;stopMonitoringDocumentStateChangesForFile:onTarget:</a></code>
		<span class="tooltip"><p>Stop monitoring changes to the state of a document stored in iCloud</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Resolving iCloud Conflicts" name="task_Resolving iCloud Conflicts"></a>
						<h3 class="subsubtitle task-title">Resolving iCloud Conflicts</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/findUnresolvedConflictingVersionsOfFile:">&ndash;&nbsp;findUnresolvedConflictingVersionsOfFile:</a></code>
		<span class="tooltip"><p>Find all the conflicting versions of a specified document</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/resolveConflictForFile:withSelectedFileVersion:">&ndash;&nbsp;resolveConflictForFile:withSelectedFileVersion:</a></code>
		<span class="tooltip"><p>Your application can follow one of three strategies for resolving document-version conflicts:</p>

<ul>
<li>Merge the changes from the conflicting versions.</li>
<li>Choose one of the document versions based on some pertinent factor, such as the version with the latest modification date.</li>
<li>Enable the user to view conflicting versions of a document and select the one to use.</li>
</ul>
</span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Deprecated Methods" name="task_Deprecated Methods"></a>
						<h3 class="subsubtitle task-title">Deprecated Methods</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/getListOfCloudFiles">&ndash;&nbsp;getListOfCloudFiles</a></code>
		<span class="tooltip"><p>DEPRECATED. Use <a href="#//api/name/listCloudFiles">listCloudFiles</a> instead. Get a list of files stored in iCloud (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.3. Use listCloudFiles instead.</span>)</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/saveChangesToDocumentWithName:withContent:completion:">&ndash;&nbsp;saveChangesToDocumentWithName:withContent:completion:</a></code>
		<span class="tooltip"><p>DEPRECATED. Use <a href="#//api/name/saveAndCloseDocumentWithName:withContent:completion:">saveAndCloseDocumentWithName:withContent:completion:</a> instead. Record changes made to a document in iCloud. Changes are saved when the document is closed. (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated beginning in version 7.1. Use saveAndCloseDocumentWithName:withContent:completion: instead. This method may become unavailable in a future version.</span>)</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/uploadLocalOfflineDocumentsWithDelegate:">+&nbsp;uploadLocalOfflineDocumentsWithDelegate:</a></code>
		<span class="tooltip"><p>DEPRECATED. Use uploadLocalOfflineDocuments instead, like so: [[iCloud sharedCloud] uploadLocalOfflineDocuments]; (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.0. Use uploadLocalOfflineDocuments instead.</span>)</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/updateFilesWithDelegate:">+&nbsp;updateFilesWithDelegate:</a></code>
		<span class="tooltip"><p>DEPRECATED. Use updateFiles instead, like so: [[iCloud sharedCloud] updateFiles]; (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.0. Use updateFiles instead.</span>)</p></span>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/delegate" title="delegate"></a>
	<h3 class="subsubtitle method-title">delegate</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>iCloud Delegate helps call methods when document processes begin or end</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (weak, nonatomic) id&lt;iCloudDelegate&gt; delegate</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/fileList" title="fileList"></a>
	<h3 class="subsubtitle method-title">fileList</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>A list of iCloud files from the current <a href="#//api/name/query">query</a></p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (strong) NSMutableArray *fileList</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/previousQueryResults" title="previousQueryResults"></a>
	<h3 class="subsubtitle method-title">previousQueryResults</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>A list of iCloud files from the previous <a href="#//api/name/query">query</a></p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (strong) NSMutableArray *previousQueryResults</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/query" title="query"></a>
	<h3 class="subsubtitle method-title">query</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The current NSMetadataQuery object</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (strong) NSMetadataQuery *query</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/verboseAvailabilityLogging" title="verboseAvailabilityLogging"></a>
	<h3 class="subsubtitle method-title">verboseAvailabilityLogging</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Enable verbose availability logging for repeated feedback about iCloud availability in the log. Turning this off will prevent availability-related messages from being printed in the log. This property does not relate to the <a href="#//api/name/verboseLogging">verboseLogging</a> property.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property BOOL verboseAvailabilityLogging</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/verboseLogging" title="verboseLogging"></a>
	<h3 class="subsubtitle method-title">verboseLogging</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Enable verbose logging for detailed feedback in the log. Turning this off only prints crucial log notes such as errors.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property BOOL verboseLogging</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/sharedCloud" title="sharedCloud"></a>
	<h3 class="subsubtitle method-title">sharedCloud</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>iCloud shared instance object</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)sharedCloud</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The shared instance of iCloud</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/updateFilesWithDelegate:" title="updateFilesWithDelegate:"></a>
	<h3 class="subsubtitle method-title">updateFilesWithDelegate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>DEPRECATED. Use updateFiles instead, like so: [[iCloud sharedCloud] updateFiles]; (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.0. Use updateFiles instead.</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (void)updateFilesWithDelegate:(id&lt;iCloudDelegate&gt;)<em>delegate</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>delegate</em></dt>
			<dd><p>The <a href="../Protocols/iCloudDelegate.html">iCloudDelegate</a> object to be used for <a href="#//api/name/delegate">delegate</a> notifications</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/uploadLocalOfflineDocumentsWithDelegate:" title="uploadLocalOfflineDocumentsWithDelegate:"></a>
	<h3 class="subsubtitle method-title">uploadLocalOfflineDocumentsWithDelegate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>DEPRECATED. Use uploadLocalOfflineDocuments instead, like so: [[iCloud sharedCloud] uploadLocalOfflineDocuments]; (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.0. Use uploadLocalOfflineDocuments instead.</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (void)uploadLocalOfflineDocumentsWithDelegate:(id&lt;iCloudDelegate&gt;)<em>delegate</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>delegate</em></dt>
			<dd><p>The <a href="../Protocols/iCloudDelegate.html">iCloudDelegate</a> object to be used for <a href="#//api/name/delegate">delegate</a> notifications</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/checkCloudAvailability" title="checkCloudAvailability"></a>
	<h3 class="subsubtitle method-title">checkCloudAvailability</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Check whether or not iCloud is available and that it can be accessed. Returns a boolean value.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)checkCloudAvailability</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if iCloud is available. NO if iCloud is not available.</p>
	</div>
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>You should always check if iCloud is available before performing any iCloud operations (every method checks to make sure iCloud is available before continuing). Additionally, you may want to check if your users want to opt-in to iCloud on a per-app basis (according to Apple&rsquo;s documentation, you should only ask the user once to opt-in to iCloud). The Return value could be <strong>NO</strong> (iCloud Unavailable) for one or more of the following reasons:</p>

<ul>
<li> iCloud is turned off by the user</li>
<li> The entitlements profile, code signing identity, and/or provisioning profile is invalid</li>
</ul>


<p>This method uses the ubiquityIdentityToken to check if iCloud is available. The <a href="#//api/name/delegate">delegate</a> method iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer: can be used to automatically detect changes in the availability of iCloud. A ubiquity token is passed in that method which lets you know if the iCloud account has changed.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/checkCloudUbiquityContainer" title="checkCloudUbiquityContainer"></a>
	<h3 class="subsubtitle method-title">checkCloudUbiquityContainer</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Check that the current application&rsquo;s iCloud Ubiquity Container is available. Returns a boolean value.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)checkCloudUbiquityContainer</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the iCloud ubiquity container is available. NO if the ubiquity container is not available.</p>
	</div>
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>This method may not return immediately, depending on a number of factors. It is not necessary to call this method directly, although it may become useful in certain situations.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/deleteDocumentWithName:completion:" title="deleteDocumentWithName:completion:"></a>
	<h3 class="subsubtitle method-title">deleteDocumentWithName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Delete a document from iCloud.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)deleteDocumentWithName:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document to delete from iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when a file is successfully deleted from iCloud. The NSError object contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Permanently delete a document stored in iCloud. This will only affect copies of the specified file stored in iCloud, if there is a copy stored locally it will not be affected.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/documentStateForFile:completion:" title="documentStateForFile:completion:"></a>
	<h3 class="subsubtitle method-title">documentStateForFile:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get the current document state of a file stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)documentStateForFile:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( UIDocumentState *documentState , NSString *userReadableDocumentState , NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Completion handler that passes three parameters, an NSError, NSString and a UIDocumentState. The documentState parameter represents the document state that the specified file is currently in (may be nil if the file does not exist). The userReadableDocumentState parameter is an NSString which succinctly describes the current document state; if the file does not exist, a non-scary error will be displayed. The NSError parameter will contain a 404 error if the file does not exist.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/doesFileExistInCloud:" title="doesFileExistInCloud:"></a>
	<h3 class="subsubtitle method-title">doesFileExistInCloud:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Check if a file exists in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)doesFileExistInCloud:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the UIDocument in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>BOOL value, YES if the file does exist in iCloud, NO if it does not. May return NO if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/duplicateOriginalDocument:withNewName:completion:" title="duplicateOriginalDocument:withNewName:completion:"></a>
	<h3 class="subsubtitle method-title">duplicateOriginalDocument:withNewName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Duplicate a document in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)duplicateOriginalDocument:(NSString *)<em>documentName</em> withNewName:(NSString *)<em>newName</em> completion:(void ( ^ ) ( NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document being duplicated in iCloud. The file specified should exist, otherwise an error will occur. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>newName</em></dt>
			<dd><p>The new name which the document should be duplicated to (usually the same name with the word &ldquo;copy&rdquo; appended to the end). The file specified should not exist, otherwise an error will occur. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document duplication has completed. The completion block passes and NSError object which contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/evictCloudDocumentWithName:completion:" title="evictCloudDocumentWithName:completion:"></a>
	<h3 class="subsubtitle method-title">evictCloudDocumentWithName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Evict a document from iCloud, move it from iCloud to the current application&rsquo;s local documents directory.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)evictCloudDocumentWithName:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the iCloud document being downloaded from iCloud to the local documents directory. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called after the file has been uploaded to iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Remove a document from iCloud storage and move it into the local document&rsquo;s directory. This method may call the iCloudFileConflictBetweenCloudFile:andLocalFile: iCloud Delegate method if there is a file conflict.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/fileCreatedDate:" title="fileCreatedDate:"></a>
	<h3 class="subsubtitle method-title">fileCreatedDate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get the creation date of a file stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSDate *)fileCreatedDate:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The date that the file was created. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/fileModifiedDate:" title="fileModifiedDate:"></a>
	<h3 class="subsubtitle method-title">fileModifiedDate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get the last modified date of a file stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSDate *)fileModifiedDate:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The date that the file was last modified. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/fileSize:" title="fileSize:"></a>
	<h3 class="subsubtitle method-title">fileSize:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get the size of a file stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSNumber *)fileSize:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The number of bytes in an unsigned long long. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/findUnresolvedConflictingVersionsOfFile:" title="findUnresolvedConflictingVersionsOfFile:"></a>
	<h3 class="subsubtitle method-title">findUnresolvedConflictingVersionsOfFile:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Find all the conflicting versions of a specified document</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSArray *)findUnresolvedConflictingVersionsOfFile:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An array of NSFileVersion objects, or nil if no such version object exists.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/getListOfCloudFiles" title="getListOfCloudFiles"></a>
	<h3 class="subsubtitle method-title">getListOfCloudFiles</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>DEPRECATED. Use <a href="#//api/name/listCloudFiles">listCloudFiles</a> instead. Get a list of files stored in iCloud (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated in version 7.3. Use listCloudFiles instead.</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSArray *)getListOfCloudFiles</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>NSArray with a list of all the files currently stored in your app&rsquo;s iCloud Documents directory. May return a nil value if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/listCloudFiles" title="listCloudFiles"></a>
	<h3 class="subsubtitle method-title">listCloudFiles</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get a list of files stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSArray *)listCloudFiles</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>NSArray with a list of all the files currently stored in your app&rsquo;s iCloud Documents directory. May return a nil value if iCloud is unavailable.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/monitorDocumentStateForFile:onTarget:withSelector:" title="monitorDocumentStateForFile:onTarget:withSelector:"></a>
	<h3 class="subsubtitle method-title">monitorDocumentStateForFile:onTarget:withSelector:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Monitor changes in the state of a document stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)monitorDocumentStateForFile:(NSString *)<em>documentName</em> onTarget:(id)<em>sender</em> withSelector:(SEL)<em>selector</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>sender</em></dt>
			<dd><p>Object registering as an observer. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>selector</em></dt>
			<dd><p>Selector to be called when the document state changes. Must only have one argument, an instance of NSNotifcation whose object is an <a href="../Classes/iCloudDocument.html">iCloudDocument</a> (UIDocument subclass). This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the monitoring was successfully setup, NO if there was an issue setting up the monitoring.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/renameOriginalDocument:withNewName:completion:" title="renameOriginalDocument:withNewName:completion:"></a>
	<h3 class="subsubtitle method-title">renameOriginalDocument:withNewName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Rename a document in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)renameOriginalDocument:(NSString *)<em>documentName</em> withNewName:(NSString *)<em>newName</em> completion:(void ( ^ ) ( NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document being renamed in iCloud. The file specified should exist, otherwise an error will occur. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>newName</em></dt>
			<dd><p>The new name which the document should be renamed with. The file specified should not exist, otherwise an error will occur. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document renaming has completed. The completion block passes and NSError object which contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/resolveConflictForFile:withSelectedFileVersion:" title="resolveConflictForFile:withSelectedFileVersion:"></a>
	<h3 class="subsubtitle method-title">resolveConflictForFile:withSelectedFileVersion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Your application can follow one of three strategies for resolving document-version conflicts:</p>

<ul>
<li>Merge the changes from the conflicting versions.</li>
<li>Choose one of the document versions based on some pertinent factor, such as the version with the latest modification date.</li>
<li>Enable the user to view conflicting versions of a document and select the one to use.</li>
</ul>

	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)resolveConflictForFile:(NSString *)<em>documentName</em> withSelectedFileVersion:(NSFileVersion *)<em>documentVersion</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentVersion</em></dt>
			<dd><p>The version of the document which should be kept and saved. All other conflicting versions will be removed.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/retrieveCloudDocumentObjectWithName:" title="retrieveCloudDocumentObjectWithName:"></a>
	<h3 class="subsubtitle method-title">retrieveCloudDocumentObjectWithName:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Get the relevant <a href="../Classes/iCloudDocument.html">iCloudDocument</a> object for the specified file</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (iCloudDocument *)retrieveCloudDocumentObjectWithName:(NSString *)<em>documentName</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the UIDocument stored in iCloud. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An <a href="../Classes/iCloudDocument.html">iCloudDocument</a> (UIDocument subclass) object. May return nil if iCloud is unavailable or if an error occurred</p>
	</div>
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>This method serves a very different purpose from the <a href="#//api/name/retrieveCloudDocumentWithName:completion:">retrieveCloudDocumentWithName:completion:</a> method. Understand the differences between both methods and ensure that you are using the correct one. This method does not open, create, or save any UIDocuments - it simply returns the <a href="../Classes/iCloudDocument.html">iCloudDocument</a> object which you can then use for various purposes.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/retrieveCloudDocumentWithName:completion:" title="retrieveCloudDocumentWithName:completion:"></a>
	<h3 class="subsubtitle method-title">retrieveCloudDocumentWithName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Open a UIDocument stored in iCloud. If the document does not exist, a new blank document will be created using the documentName provided. You can use the <a href="#//api/name/doesFileExistInCloud:">doesFileExistInCloud:</a> method to check if a file exists before calling this method.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)retrieveCloudDocumentWithName:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document in iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document is successfully retrieved (opened or downloaded). The completion block passes UIDocument and NSData objects containing the opened document and it&rsquo;s contents in the form of NSData. If there is an error, the NSError object will have an error message (may be nil if there is no error). This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>This method will attempt to open the specified document. If the file does not exist, a blank one will be created. The completion handler is called when the file is opened or created (either successfully or not). The completion handler contains a UIDocument, NSData, and NSError all of which contain information about the opened document.</p>

<pre><code>[[iCloud sharedCloud] retrieveCloudDocumentWithName:@"docName.ext" completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) {
    if (error == nil) {
        NSString *documentName = [cloudDocument.fileURL lastPathComponent];
        NSData *fileData = documentData;
    }
 }];
</code></pre>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveAndCloseDocumentWithName:withContent:completion:" title="saveAndCloseDocumentWithName:withContent:completion:"></a>
	<h3 class="subsubtitle method-title">saveAndCloseDocumentWithName:withContent:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Create, save, and close a document in iCloud.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)saveAndCloseDocumentWithName:(NSString *)<em>documentName</em> withContent:(NSData *)<em>content</em> completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document being written to iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>content</em></dt>
			<dd><p>The data to write to the document</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document is successfully saved. The completion block passes UIDocument and NSData objects containing the saved document and it&rsquo;s contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>First, iCloud Document Sync checks if the specified document exists. If the document exists it is saved and closed. If the document does not exist, it is created then closed.</p>

<p>iCloud Document Sync uses UIDocument and NSData to store and manage files. All of the heavy lifting with NSData and UIDocument is handled for you. There&rsquo;s no need to actually create or manage any files, just give iCloud Document Sync your data, and the rest is done for you.</p>

<p>To create a new document or save an existing one (close the document), use this method. Below is a code example of how to use it.</p>

<pre><code>[[iCloud sharedCloud] saveAndCloseDocumentWithName:@"Name.ext" withContent:[NSData data] completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) {
    if (error == nil) {
        // Code here to use the UIDocument or NSData objects which have been passed with the completion handler
    }
}];
</code></pre>

<p>Documents can be created even if the user is not connected to the internet. The only case in which a document will not be created is when the user has disabled iCloud or if the current application is not setup for iCloud.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/saveChangesToDocumentWithName:withContent:completion:" title="saveChangesToDocumentWithName:withContent:completion:"></a>
	<h3 class="subsubtitle method-title">saveChangesToDocumentWithName:withContent:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>DEPRECATED. Use <a href="#//api/name/saveAndCloseDocumentWithName:withContent:completion:">saveAndCloseDocumentWithName:withContent:completion:</a> instead. Record changes made to a document in iCloud. Changes are saved when the document is closed. (<b class="deprecated">Deprecated:</b><span class="deprecated"> Deprecated beginning in version 7.1. Use saveAndCloseDocumentWithName:withContent:completion: instead. This method may become unavailable in a future version.</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)saveChangesToDocumentWithName:(NSString *)<em>documentName</em> withContent:(NSData *)<em>content</em> completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the document being written to iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>content</em></dt>
			<dd><p>The data to write to the document</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document changes are recorded. The completion block passes UIDocument and NSData objects containing the saved document and it&rsquo;s contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/shareDocumentWithName:completion:" title="shareDocumentWithName:completion:"></a>
	<h3 class="subsubtitle method-title">shareDocumentWithName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Share an iCloud document by uploading it to a public URL.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSURL *)shareDocumentWithName:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( NSURL *sharedURL , NSDate *expirationDate , NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the iCloud file being uploaded to a public URL. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called when the document is successfully uploaded. The completion block passes NSURL, NSDate, and NSError objects. The NSURL object is the public URL where the file is available at, could be nil. The NSDate object is the date that the URL expires on, could be nil. The NSError object contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The public URL where the file is available</p>
	</div>
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Upload a document stored in iCloud to a public location on the internet for a limited amount of time.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/stopMonitoringDocumentStateChangesForFile:onTarget:" title="stopMonitoringDocumentStateChangesForFile:onTarget:"></a>
	<h3 class="subsubtitle method-title">stopMonitoringDocumentStateChangesForFile:onTarget:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Stop monitoring changes to the state of a document stored in iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)stopMonitoringDocumentStateChangesForFile:(NSString *)<em>documentName</em> onTarget:(id)<em>sender</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the file in iCloud. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>sender</em></dt>
			<dd><p>Object registered as an observer that will no longer receive document state updates. This value must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the monitoring was successfully setup, NO if there was an issue setting up the monitoring.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/ubiquitousContainerURL" title="ubiquitousContainerURL"></a>
	<h3 class="subsubtitle method-title">ubiquitousContainerURL</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Retrieve the current application&rsquo;s ubiquitous root URL</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSURL *)ubiquitousContainerURL</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An NSURL with the root iCloud Ubiquitous URL for the current app. May return nil if iCloud is not properly setup or available.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/ubiquitousDocumentsDirectoryURL" title="ubiquitousDocumentsDirectoryURL"></a>
	<h3 class="subsubtitle method-title">ubiquitousDocumentsDirectoryURL</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Retrieve the current application&rsquo;s ubiquitous documents directory URL</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (NSURL *)ubiquitousDocumentsDirectoryURL</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>An NSURL with the iCloud ubiquitous documents directory URL for the current app. May return nil if iCloud is not properly setup or available.</p>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/updateFiles" title="updateFiles"></a>
	<h3 class="subsubtitle method-title">updateFiles</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Check for and update the list of files stored in your app&rsquo;s iCloud Documents Folder. This method is automatically called by iOS when there are changes to files in the iCloud Directory. The iCloudFilesDidChange:withNewFileNames: <a href="#//api/name/delegate">delegate</a> method is triggered by this method.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)updateFiles</code></div>

    
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/uploadLocalDocumentToCloudWithName:completion:" title="uploadLocalDocumentToCloudWithName:completion:"></a>
	<h3 class="subsubtitle method-title">uploadLocalDocumentToCloudWithName:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Upload a local file to iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)uploadLocalDocumentToCloudWithName:(NSString *)<em>documentName</em> completion:(void ( ^ ) ( NSError *error ))<em>handler</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>documentName</em></dt>
			<dd><p>The name of the local file stored in the application&rsquo;s documents directory. This value must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>handler</em></dt>
			<dd><p>Code block called after the file has been uploaded to iCloud</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/uploadLocalOfflineDocumentsWithRepeatingHandler:completion:" title="uploadLocalOfflineDocumentsWithRepeatingHandler:completion:"></a>
	<h3 class="subsubtitle method-title">uploadLocalOfflineDocumentsWithRepeatingHandler:completion:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Upload any local files that weren&rsquo;t created with iCloud</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)uploadLocalOfflineDocumentsWithRepeatingHandler:(void ( ^ ) ( NSString *documentName , NSError *error ))<em>repeatingHandler</em> completion:(void ( ^ ) ( void ))<em>completion</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>repeatingHandler</em></dt>
			<dd><p>Code block called after each file is uploaded to iCloud. This block is called every-time a local file is uploaded, therefore it may be called multiple times. The NSError object contains any error information if an error occurred, otherwise it will be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>completion</em></dt>
			<dd><p>Code block called after all files have been uploaded to iCloud. This block is only called once at the end of the method, regardless of any successes or failures that may have occurred during the upload(s).</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Files in the local documents directory that do not already exist in iCloud will be <strong>moved</strong> into iCloud one by one. This process involves lots of file manipulation and as a result it may take a long time. This process will be performed on the background thread to avoid any lag or memory problems. When the upload processes end, the completion block is called on the main thread.</p>

<pre><code>[[iCloud sharedCloud] uploadLocalOfflineDocumentsWithRepeatingHandler:^(NSString *documentName, NSError *error) {
    if (error == nil) {
        // This code block is called repeatedly until all files have been uploaded (or an upload has at least been attempted). 
        // Code here to use the NSString (the name of the uploaded file) which have been passed with the repeating handler
    }
 } completion:^{
     // Completion handler could be used to tell the user that the upload has completed
 }];
</code></pre>

<p>This method may call the iCloudFileConflictBetweenCloudFile:andLocalFile: iCloud Delegate method if there is a file conflict.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">iCloud.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-08-03)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>